package day05;

import java.util.Scanner;

public class Addition1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("游戏开始");
        int s = 0;
        for (int i = 1;i <= 10;i++){
            int x = (int) (Math.random()*1000);
            int y = (int) (Math.random()*1000);
            System.out.println("("+i+")"+x+"+"+y+"=?");
            int z = scanner.nextInt();
            if (z == x+y){
                System.out.println("恭喜你，这题答对了");
                s++;
            }else {
                System.out.println("很遗憾，这题你答错了");
            }
        }
        System.out.println("总分为"+s+"分");
    }
}
